Toggle navigation
Ivan's Wiki
Wiki Home
(current)
Submit
Index
SafeC Compilers
Buffer Overflows:
Instrument the program with dynamic buffer overflow checks
Fat Pointers:
Store the start and end address in the pointer (extend pointers)
Increase pointer size
Pointers do not fit in the registers
Looses bounds when pointers are converted to integers and back
Not backwards compatible with existing code
Jones and Kelly Compiler:
Does not change the pointer representation
Keep the end address of the pointer in a table and validate pointers based on that
Pointers validated at dereferencing
Object table functionality is implemented with
Splay Trees
Flaws:
Pointer to integer conversion looses the checks
One past the end of the array (in C it is legal to have a pointer to that)
CRED Compiler:
Allows OOB pointers for better compatibility with existing code
Evaluates each pointer individually (no valid pointer is marked as invalid)
Boundless Memory Blocks Compiler:
User a SafeC compiler to detect all OOB accesses
Store OOB writes in a hash table
Conceptually give each allocated memory block its own address space and unbounded size
Extend memory by spacing out each allocated block with a writable buffer
Issues:
Possible DOS attack (large number of writes)
Mitigated by treating the hash tables as a fixed-size cache
Evaluation:
Developers are more likely to incorrectly calculate the size of a buffer
Developers are likely to omit the bounds check
Cache misses and uninitialised reads are rare
Conceptually unbounded memory blocks mitigate most of the security vulnerabilities
Summary:
In most cases overhead of ~25% is impractical to use in production
Could be used for offline testing, but
Compiler sanitisers
tend to perform better